<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{ search_type }}</title>
      <link href="/static/bootstrap/css/bootstrap.css" rel="stylesheet" >
      <script src="/static/bootstrap/js/bootstrap.bundle.min.js" ></script>
  </head>
  <body>



<div class="container">
  <h1>详细情形</h1>
  <p>{{ model_name  }}-{{ search_type }}</p>
    <p>品名:{{ qset.raw.name }},批号:{{ qset.batch_number }},入库总数量:{{ qset.store_num }}{{ qset.unit }},剩余数量:{{ qset.remaining_num }}{{ qset.unit }} </p>
</div>
<div class="container">

<!-- 展示列表数据 -->
<div class="table-responsive-sm">
<table class="table table-striped table-hover ">
    <thead>
        <tr>
            <!-- 循环模型的字段，排除自动生成的id -->
              {% for field, value in list_reuslt.0.items %}  <!-- 取第一条数据的字段名 -->
                  {% for k, v in FIELDS.items %}  <!-- 循环FIELDS的键值对 -->
                    {% if k == field %}  <!-- 字段名匹配时 -->
                      <th>{{ v }}</th>  <!-- 显示FIELDS中定义的标题 -->
                    {% endif %}
                  {% endfor %}
                {% endfor %}
        </tr>
    </thead>
    <tbody>
       {% for result in list_reuslt %}  <!-- 遍历值列表 -->
            <tr >
                {% for value in result.values %}  <!-- 遍历每个对象的字段值 -->
                    <td>{{ value }}</td>
                {% endfor %}
            </tr>
            {% empty %}
            <tr>
                <td colspan="4">暂无数据</td>
            </tr>
            {% endfor %}
    </tbody>
</table>
</div>


</div>
  </body>
</html>
